package com.hotdog.controller;


import com.hotdog.pojo.LogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 接收日志入库请求
 * @author 郭鲁政
 */
@RequestMapping("/log")
@RestController
public class LogInfoController {
    @Autowired
    private com.hotdog.service.logInfoService logInfoService;
    @GetMapping("/insertLogInfo/{username}/{resourcesAccessed}")
    public void logInfo(@PathVariable("username") String username,@PathVariable("resourcesAccessed") String resourcesAccessed){
        LogInfo logInfo = new LogInfo();
        logInfo.setUsername(username).setResourcesAccessed(resourcesAccessed);
        logInfoService.insertLogInfo(logInfo);
    }
}
